<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * This file sets up the post install logs
 *
 * @package   blocks-email_list
 * @author    Tyler Bannister <tyler.bannister@remote-learner.net>
 * @copyright 2011 Remote Learner http://www.remote-learner.net/
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @since     2.0
 */

/**
 * Setup logs
 *
 * @return void
 */
function xmldb_block_email_list_log() {
    global $DB;

    $table = 'log_display';

    $log = new object();
    $log->module = 'email_list';
    $log->action = 'add mail';
    $log->mtable = 'block_email_list_mail';
    $log->field  = 'subject';

    $DB->insert_record($table, $log);

    $log->action = 'add mail in draft';
    $DB->insert_record($table, $log);

    $log->action = 'reply';
    $DB->insert_record($table, $log);

    $log->action = 'reply all';
    $DB->insert_record($table, $log);

    $log->action = 'forward';
    $DB->insert_record($table, $log);

    $log->action = 'add subfolder';
    $log->mtable = 'block_email_list_folder';
    $log->field  = 'name';
    $DB->insert_record($table, $log);

    $log->action = 'update subfolder';
    $DB->insert_record($table, $log);

    $log->action = 'remove subfolder';
    $DB->insert_record($table, $log);

    $log->action = 'view course mails';
    $log->mtable = 'block_email_list_send';
    $DB->insert_record($table, $log);

    $log->action = 'view all course mails';
    $DB->insert_record($table, $log);

    $log->action = 'view mail';
    $DB->insert_record($table, $log);

    $log->action = 'remove mail';
    $DB->insert_record($table, $log);
}
